<% include ../pageHeader %>

<div id="mainWrapper">
    <script type="text/javascript" language="javascript" src="/public/messageform.js"></script>
    <form name="inputform" method="post" action="<%= formAction %>">
        <input name="_csrf" type="hidden" value="<%- ctx.csrf %>" />
        <table width="100%" border="0" align="center" cellpadding="4" cellspacing="1" class="formbox">
            <tr>
                <td colspan="2" class="formbox-title"><%= formTitle %></td>
            </tr>
            <tr>
                <td class="formbox-rowheader" width="140"><b><%= __('category') %>:</b></td>
                <td class="formbox-content">
                    <select name="log_catid" id="log_catid">
                        <option value="0">- <%= __('select_category') %> -</option>
                        <% for(var i = 0;i < theCache.categories.length;i++){
                        if(!theCache.categories[i].hidden ||
                                (theCache.categories[i].hidden && theUser.rights["view"] > 1)){ %>
                            <option value="<%= theCache.categories[i].id %>"
                                    <% if(objArticle.categoryID == theCache.categories[i].id) { %>
                                             selected="selected" <% } %>
                            ><%= theCache.categories[i].name %> [<%= theCache.categories[i].articleCount %>]
                            </option>
                        <% }
                        } %>
                    </select>
                    &nbsp;&nbsp;
                    <b><%= __('mode') %>:</b>
                    <select name="log_mode" id="log_mode">
                        <option value="1"
                                <% if(objArticle.mode == 1) { %>
                                selected="selected" <% } %>
                        ><%= __('public') %></option>
                        <option value="2"
                                <% if(objArticle.mode == 2) { %>
                                selected="selected" <% } %>
                        ><%= __('draft') %></option>
                        <option value="3"
                                <% if(objArticle.mode == 3) { %>
                                selected="selected" <% } %>
                        ><%= __('hidden') %></option>
                        <option value="4"
                                <% if(objArticle.mode == 4) { %>
                                selected="selected" <% } %>
                        ><%= __('private') %></option>
                    </select>
                    &nbsp;&nbsp;
                    <input name="log_locked" type="checkbox" id="log_locked" value="true"
                            <% if(objArticle.locked) { %> checked="checked" <% } %>
                    /> <%= __('locked') %>
                    <% if(bEdit){ %>
                        &nbsp;&nbsp;
                        <a href="?act=delete&id=<%= objArticle.id %>"
                           onclick="return confirm('<%= __('confirm_delete_article') %>?')"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/icon_del.gif"/> <%= __('delete') %></a>
                    <% } %>
                </td>
            </tr>
            <tr>
                <td class="formbox-rowheader"><b><%= __('title') %>:</b></td>
                <td class="formbox-content">
                    <input name="log_title" type="text" id="log_title" size="60"
                           value="<%= helper.HTMLEncodeLite(objArticle.title) %>" maxlength="255" class="text"/>&nbsp;&nbsp;
                    <input name="log_selected" type="checkbox" id="log_selected" value="true"
                            <% if(objArticle.selected) { %> checked="checked" <% } %>
                    /> <%= __('selected') %>
                    <input name="log_id" type="hidden" value="<%= objArticle.id %>"/>
                </td>
            </tr>
            <tr>
                <td class="formbox-rowheader"><b><%= __('post_time') %>:</b></td>
                <td class="formbox-content">
                    <input name="log_postTime" type="text" id="log_postTime" size="20"
                           value="<%= helper.getDateTimeString("YY-MM-DD hh:ii:ss", objArticle.postTime) %>"
                           maxlength="20" class="text"/>&nbsp;&nbsp&nbsp;<a
                            href="javascript:setToCurrentTime()"><%= __('set_to_current') %></a>
                </td>
            </tr>
            <tr>
                <td class="formbox-rowheader" valign="top">
                    <b><%= __('content') %>:</b><br/><br/>
                    <div class="panel-smilies">
                        <div class="panel-smilies-title"><%= __('smilies') %></div>
                        <div class="panel-smilies-content">
                            <% for(var i = 0;i < theCache.smilies.length;i++){ %>
                                <a href="javascript:insertSmilies('<%= theCache.smilies[i].code %>')"><img
                                            src="/public/<%= theCache.settings["smiliesFolder"] %>/<%= theCache.smilies[i].image %>"
                                            alt="<%= theCache.smilies[i].code %>"/></a>
                                <% if((i + 1) % theCache.settings["smiliesPerRow"] == 0) { %> <br /> <% } %>
                            <% } %>
                        </div>
                    </div>
                    <div style="font-weight: normal; text-align:left;">
                        <input name="e_html" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags == "html") { %> checked="checked" <% } %>
                        /> <%= __('e_html') %><br/>
                        <input name="e_ubb" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags != "html" && objArticle.ubbFlags.substr(0, 1) == "1") { %> checked="checked" <% } %>
                        /> <%= __('e_ubb') %><br/>
                        <input name="e_autourl" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags != "html" && objArticle.ubbFlags.substr(1, 1) == "1") { %> checked="checked" <% } %>
                        /> <%= __('e_autourl') %><br/>
                        <input name="e_image" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags != "html" && objArticle.ubbFlags.substr(2, 1) == "1") { %> checked="checked" <% } %>
                        /> <%= __('e_image') %><br/>
                        <input name="e_media" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags != "html" && objArticle.ubbFlags.substr(3, 1) == "1") { %> checked="checked" <% } %>
                        /> <%= __('e_media') %><br/>
                        <input name="e_smilies" type="checkbox" value="true"
                                <% if(objArticle.ubbFlags != "html" && objArticle.ubbFlags.substr(4, 1) == "1") { %> checked="checked" <% } %>
                        /> <%= __('e_smilies') %>
                    </div>
                </td>
                <td class="formbox-content">
                    <div style="padding-bottom:3px">
                        <select name="font" onfocus="this.selectedIndex=0"
                                onchange="chfont(this.options[this.selectedIndex].value)">
                            <option value="" selected="selected">- Select Font -</option>
                            <option value="Arial">Arial</option>
                            <option value="Book Antiqua">Book Antiqua</option>
                            <option value="Century Gothic">Century Gothic</option>
                            <option value="Courier New">Courier New</option>
                            <option value="Georgia">Georgia</option>
                            <option value="Impact">Impact</option>
                            <option value="Tahoma">Tahoma</option>
                            <option value="Times New Roman">Times New Roman</option>
                            <option value="Verdana">Verdana</option>
                        </select>
                        <select name="size" onfocus="this.selectedIndex=0"
                                onchange="chsize(this.options[this.selectedIndex].value)">
                            <option value="" selected="selected">- Size (pt) -</option>
                            <option value="8">8</option>
                            <option value="9">9</option>
                            <option value="12">12</option>
                            <option value="16">16</option>
                            <option value="18">18</option>
                            <option value="24">24</option>
                            <option value="28">28</option>
                            <option value="32">32</option>
                            <option value="36">36</option>
                        </select>
                        <select name="color" onfocus="this.selectedIndex=0"
                                onchange="chcolor(this.options[this.selectedIndex].value)">
                            <option value="" selected="selected">- Color -</option>
                            <option value="White" style="background-color:white;color:white;">White</option>
                            <option value="Black" style="background-color:black;color:black;">Black</option>
                            <option value="Red" style="background-color:red;color:red;">Red</option>
                            <option value="Yellow" style="background-color:yellow;color:yellow;">Yellow</option>
                            <option value="Pink" style="background-color:pink;color:pink;">Pink</option>
                            <option value="Green" style="background-color:green;color:green;">Green</option>
                            <option value="Orange" style="background-color:orange;color:orange;">Orange</option>
                            <option value="Purple" style="background-color:purple;color:purple;">Purple</option>
                            <option value="Blue" style="background-color:blue;color:blue;">Blue</option>
                            <option value="Beige" style="background-color:beige;color:beige;">Beige</option>
                            <option value="Brown" style="background-color:brown;color:brown;">Brown</option>
                            <option value="Teal" style="background-color:teal;color:teal;">Teal</option>
                            <option value="Navy" style="background-color:navy;color:navy;">Navy</option>
                            <option value="Maroon" style="background-color:maroon;color:maroon;">Maroon</option>
                            <option value="LimeGreen" style="background-color:limegreen;color:limegreen;">LimeGreen
                            </option>
                        </select> &nbsp;
                        <input type="radio" name="mode" value="1" onclick="chmode(1)" checked="checked"/> Basic
                        <input type="radio" name="mode" value="0" onclick="chmode(0)"/> Prompt
                    </div>
                    <div>
                        <a href="javascript:bold()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_bold.gif" alt="Bold"/></a>
                        <a href="javascript:italicize()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_italicize.gif"
                                    alt="Italic"/></a> <a href="javascript:underline()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_underline.gif"
                                    alt="Underline"/></a> <a href="javascript:strike()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_strike.gif"
                                    alt="Strike Line"/></a> <a href="javascript:superscript()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_sup.gif"
                                    alt="Insert Superscript"/></a> <a href="javascript:subscript()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_sub.gif"
                                    alt="Insert Subscript"/></a> <a href="javascript:center()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_center.gif"
                                    alt="Align Center"/></a> <a href="javascript:hyperlink()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_url.gif" alt="Insert URL"/></a>
                        <a href="javascript:email()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_email.gif"
                                    alt="Insert Mail Link"/></a> <a href="javascript:image()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_image.gif"
                                    alt="Insert Image"/></a> <a href="javascript:media()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_media.gif"
                                    alt="Insert Flash"/></a> <a href="javascript:code()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_code.gif"
                                    alt="Insert Code Block"/></a> <a href="javascript:quote()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_quote.gif"
                                    alt="Insert Quote"/></a> <a href="javascript:list()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_list.gif"
                                    alt="Insert List"/></a> <a href="javascript:seperator()"><img
                                    src="/public/<%= theCache.settings["imageFolder"] %>/ubbcode/bb_seperator.gif"
                                    alt="Insert Content Separator"/></a>
                    </div>
                    <div>
                        <textarea name="message" rows="18" cols="64" id="message" style="width:100%"
                                  onselect="storeCaret(this);" onclick="storeCaret(this);"
                                  onkeyup="storeCaret(this);CtrlEnter();"><%= helper.HTMLEncodeLite(
                                    objArticle.content0 + objArticle.content1) %></textarea>
                    </div>
                </td>
            </tr>
            <% if(theUser.rights["upload"] > 0 && theCache.settings["enableUpload"] == 1){ %>
                <tr class="formbox-content">
                    <td align="right"><b><%= __('attachment') %>:</b></td>
                    <td>
                        <iframe frameborder="0" height="21" marginheight="0" marginwidth="0" scrolling="no" width="99%"
                                src="upload.asp"></iframe>
                    </td>
                </tr>
            <% } %>
            <tr class="formbox-content">
                <td align="right"><b><%= __('trackback_url') %>:</b></td>
                <td>
                    <input name="log_trackbackurl" type="text" id="log_trackbackurl" size="60"
                           value="<%= helper.URLEncode(objArticle.trackbackURL) %>" maxlength="255" class="text"/>
                </td>
            </tr>
            <tr class="formbox-content">
                <td></td>
                <td>
                    <input name="btnSubmit" type="button" id="btnSubmit" value="<%= __('save') %>"
                           onclick="CheckInputForm();" class="button"/>
                    <input name="btnReset" type="reset" id="btnReset" value="<%= __('reset') %>" class="button"/>
                    <input name="btnCancel" type="button" id="btnCancel" value="<%= __('cancel') %>"
                           onclick="window.history.back();" class="button"/>
                </td>
            </tr>
        </table>
    </form>
</div>

<% include ../pageFooter %>
